Optimal. Leaf size=401 \[ -\frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac {2 \left (d^2 f-c d g+c^2 h\right ) (a+b x)}{\left (2 b d f-b c g-a d g+2 a c h-(b c-a d) \sqrt {g^2-4 f h}\right ) (c+d x)}\right )}{\sqrt {g^2-4 f h}}+\frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac {2 \left (d^2 f-c d g+c^2 h\right ) (a+b x)}{\left (2 b d f-b c g-a d g+2 a c h+(b c-a d) \sqrt {g^2-4 f h}\right ) (c+d x)}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Li}_2\left (\frac {2 \left (d^2 f-c d g+c^2 h\right ) (a+b x)}{\left (2 b d f-b c g-a d g+2 a c h-(b c-a d) \sqrt {g^2-4 f h}\right ) (c+d x)}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Li}_2\left (\frac {2 \left (d^2 f-c d g+c^2 h\right ) (a+b x)}{\left (2 b d f-b c g-a d g+2 a c h+(b c-a d) \sqrt {g^2-4 f h}\right ) (c+d x)}\right )}{\sqrt {g^2-4 f h}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.53, antiderivative size = 401, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {2576, 2404,
2354, 2438} \begin {gather*} -\frac {n \text {PolyLog}\left (2,\frac {2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (-\sqrt {g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {PolyLog}\left (2,\frac {2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (\sqrt {g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac {2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (-\sqrt {g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac {2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (\sqrt {g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt {g^2-4 f h}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2354
Rule 2404
Rule 2438
Rule 2576
Rubi steps
\begin {align*} \int \frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{f+g x+h x^2} \, dx &=n \int \frac {\log (a+b x)}{f+g x+h x^2} \, dx-n \int \frac {\log (c+d x)}{f+g x+h x^2} \, dx-\left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac {1}{f+g x+h x^2} \, dx\\ &=n \int \left (\frac {2 h \log (a+b x)}{\sqrt {g^2-4 f h} \left (g-\sqrt {g^2-4 f h}+2 h x\right )}-\frac {2 h \log (a+b x)}{\sqrt {g^2-4 f h} \left (g+\sqrt {g^2-4 f h}+2 h x\right )}\right ) \, dx-n \int \left (\frac {2 h \log (c+d x)}{\sqrt {g^2-4 f h} \left (g-\sqrt {g^2-4 f h}+2 h x\right )}-\frac {2 h \log (c+d x)}{\sqrt {g^2-4 f h} \left (g+\sqrt {g^2-4 f h}+2 h x\right )}\right ) \, dx-\left (2 \left (-n \log (a+b x)+\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+n \log (c+d x)\right )\right ) \text {Subst}\left (\int \frac {1}{g^2-4 f h-x^2} \, dx,x,g+2 h x\right )\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {(2 h n) \int \frac {\log (a+b x)}{g-\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}-\frac {(2 h n) \int \frac {\log (a+b x)}{g+\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}-\frac {(2 h n) \int \frac {\log (c+d x)}{g-\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}+\frac {(2 h n) \int \frac {\log (c+d x)}{g+\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {(b n) \int \frac {\log \left (\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{a+b x} \, dx}{\sqrt {g^2-4 f h}}+\frac {(b n) \int \frac {\log \left (\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{a+b x} \, dx}{\sqrt {g^2-4 f h}}+\frac {(d n) \int \frac {\log \left (\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{c+d x} \, dx}{\sqrt {g^2-4 f h}}-\frac {(d n) \int \frac {\log \left (\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{c+d x} \, dx}{\sqrt {g^2-4 f h}}\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 a h+b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 c h+d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 a h+b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 c h+d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{\sqrt {g^2-4 f h}}\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Li}_2\left (\frac {2 h (a+b x)}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Li}_2\left (\frac {2 h (a+b x)}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Li}_2\left (\frac {2 h (c+d x)}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Li}_2\left (\frac {2 h (c+d x)}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 604, normalized size = 1.51 \begin {gather*} \frac {-2 \sqrt {g^2-4 f h} n \tan ^{-1}\left (\frac {g+2 h x}{\sqrt {-g^2+4 f h}}\right ) \log \left (\frac {a}{b}+x\right )+2 \sqrt {g^2-4 f h} n \tan ^{-1}\left (\frac {g+2 h x}{\sqrt {-g^2+4 f h}}\right ) \log \left (\frac {c}{d}+x\right )+2 \sqrt {g^2-4 f h} \tan ^{-1}\left (\frac {g+2 h x}{\sqrt {-g^2+4 f h}}\right ) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+\sqrt {-g^2+4 f h} n \log \left (\frac {a}{b}+x\right ) \log \left (1-\frac {2 h (a+b x)}{-b g+2 a h+b \sqrt {g^2-4 f h}}\right )-\sqrt {-g^2+4 f h} n \log \left (\frac {a}{b}+x\right ) \log \left (1+\frac {2 h (a+b x)}{-2 a h+b \left (g+\sqrt {g^2-4 f h}\right )}\right )-\sqrt {-g^2+4 f h} n \log \left (\frac {c}{d}+x\right ) \log \left (1-\frac {2 h (c+d x)}{-d g+2 c h+d \sqrt {g^2-4 f h}}\right )+\sqrt {-g^2+4 f h} n \log \left (\frac {c}{d}+x\right ) \log \left (1+\frac {2 h (c+d x)}{-2 c h+d \left (g+\sqrt {g^2-4 f h}\right )}\right )+\sqrt {-g^2+4 f h} n \text {Li}_2\left (\frac {2 h (a+b x)}{2 a h+b \left (-g+\sqrt {g^2-4 f h}\right )}\right )-\sqrt {-g^2+4 f h} n \text {Li}_2\left (\frac {2 h (a+b x)}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )-\sqrt {-g^2+4 f h} n \text {Li}_2\left (\frac {2 h (c+d x)}{-d g+2 c h+d \sqrt {g^2-4 f h}}\right )+\sqrt {-g^2+4 f h} n \text {Li}_2\left (\frac {2 h (c+d x)}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {-\left (g^2-4 f h\right )^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.53, size = 0, normalized size = 0.00 \[\int \frac {\ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )}{h \,x^{2}+g x +f}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )}{h\,x^2+g\,x+f} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________